package com.nyist.diseasepreventionserver.config;

import com.google.gson.Gson;
import com.nyist.diseasepreventionserver.VO.EpiVO;
import com.nyist.diseasepreventionserver.VO.ShowapiVO;
import com.nyist.diseasepreventionserver.common.ServerResponse;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

public class GsonVOConfig {

    public EpiVO ReturnVOConfig(String url,String date,String search) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException{
        EpiReturnConfig epiReturnConfig = new EpiReturnConfig();
        String returnConfig = epiReturnConfig.returnConfig(url, date, search);
        Gson gson = new Gson();
        ShowapiVO showapiVO = gson.fromJson(returnConfig, ShowapiVO.class);
        EpiVO showapiResBody = showapiVO.getShowapiResBody();
        return showapiResBody;
    }
}
